<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<%@ include file="/common/taglibs.jsp" %>
<head>
    <title>商品选择</title>
    <title>Title</title>
    <link rel="stylesheet" href="/assets/admin/css/pintuer.css">
    <link rel="stylesheet" href="/assets/admin/css/admin.css">
    <script type="text/javascript" src="/assets/js/myjs/jquery-3.4.1.js"></script>
    <script type="text/javascript" src="/assets/admin/js/pintuer.js"></script>
    <link href="/assets/layui/css/layui.css" rel="stylesheet">
</head>
<body>
</form>
<div class="panel admin-panel">
    <form class="layui-form" action="good/findBySql" id="listform" method="post">
        <div class="padding border-bottom">
            <ul class="serch" style="padding-left: 10px">
                <li>
                    <a class="button border-main icon-plus-square-o "
                       href="${ctx}/good/goAdd">新增商品</a>
                    <input type="text" placeholder="商品名称" name="goodName" class="input" value="${obj.goodName}"
                           style="width: 250px;line-height: 17px;display: none"/>
                    <input type="text" placeholder="商品编号" name="" class="input" value="${obj.goodName}"
                           style="width: 250px;line-height: 17px;display: inline-block"/>
                    <input type="text" placeholder="商品库存" name="" class="input" value="${obj.goodName}"
                           style="width: 250px;line-height: 17px;display: inline-block"/>
                    <div class="layui-input-inline">
                        <select name="dirId" lay-verify="required">
                            <option value="">分类</option>
                            <option value="0">仓库</option>
                            <option value="1">管理员</option>
                            <option value="2">金牌员工</option>
                            <option value="3">买家</option>
                        </select>
                    </div>
                    <input class="" type="submit" value="搜索">
                </li>
            </ul>
        </div>
    </form>
    <table class="table table-hover text-center">
        <tr>
            <th>商品名称</th>
            <th>所属栏目</th>
            <th>商品编号</th>
            <th>商品图片</th>
            <th>商品价格</th>
            <th>库存数量</th>
            <th>是否上架</th>
            <th>商品介绍</th>
            <th>创建时间</th>
        </tr>
        <c:forEach items="${pagers.datas}" var="data" varStatus="1">
        <td>${data.goodName}</td>
        <td>${data.directory.dirName}</td>
        <td>${data.goodId}</td>
        <td><img src="${data.goodImage}" alt="" style="width: 50px;height: 50px;"></td>
        <td>${data.goodPrice}</td>
        <td>${data.goodInventoryNumber}</td>
        <td>${data.goodUpdownState}</td>
        <td>${data.goodInfo}</td>
        <td><fmt:formatDate value="${data.createDate}" pattern="yyyy-MM-dd hh:mm:ss"></fmt:formatDate></td>
        <td>
            <div class="btn-group">
                <a class="button border-main" href="${ctx}/good/sonFindBySql?fatherId=${data.rowId}"><span
                        class="icon-search">详细信息</span></a>
                <a class="button border-main" href="${ctx}/good/goEdit?rowId=${data.rowId}"><span
                        class="icon-edit">修改</span></a>
                <a class="button border-red" href="${ctx}/good/delete?rowId=${data.rowId}"><span
                        class="icon-trash-o">下架</span></a>
            </div>
        </td>
        <tr>
            </c:forEach>
            <td colspan="8">
                <div class="pagelist">
                    <!--分页开始-->
                    <pg:pager url="${ctx}/good/findGood" maxIndexPages="5" items="${pagers.total}"
                              maxPageItems="15"
                              export="curPage=pageNumber">
                        <pg:last>
                            共${pagers.total}记录，共${pageNumber}页，
                        </pg:last>
                        当前第${curPage}页
                        <pg:first>
                            <a href="${pageUrl}">首页</a>
                        </pg:first>
                        <pg:prev>
                            <a href="${pageUrl}">上一页</a>
                        </pg:prev>
                        <pg:pages>
                            <c:choose>
                                <c:when test="${curPage eq pageNumber}">
                                    <font color="red">[${pageNumber}]</font>
                                </c:when>
                                <c:otherwise>
                                    <a href="${pageUrl}">${pageNumber}</a>
                                </c:otherwise>
                            </c:choose>
                        </pg:pages>
                        <pg:next>
                            <a href="${pageUrl}">下一页</a>
                        </pg:next>
                        <pg:last>
                            <c:choose>
                                <c:when test="${curPage eq pageNumber}">
                                    <font color="red">尾页</font>
                                </c:when>
                                <c:otherwise>
                                    <a href="${pageUrl}">尾页</a>
                                </c:otherwise>
                            </c:choose>
                        </pg:last>
                    </pg:pager>
                </div>
            </td>
        </tr>
    </table>
</div>
<script src="https://cdn.bootcdn.net/ajax/libs/layui/2.5.7/layui.js"></script>
<script>

    function changeSearch() {
        $('#listform').submit();
    }

    layui.use(['layer', 'form'], function () {
        var layer = layui.layer
            , form = layui.form;
    });

</script>
</body>
</html>



